//
//  UFOYZXTypeTableView.m
//  unrivalledForUniverse
//
//  Created by dllo on 16/1/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UFOYZXTypeTableView.h"
#import "Masonry.h"
@implementation UFOYZXTypeTableView
- (void)dealloc
{
    [_timeL release];
    [_titleL release];
    [_introduceL release];
    [_typeImageV release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{

    self.typeImageV = [UIImageView new];
    self.typeImageV.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.typeImageV];
    
    self.titleL = [UILabel new];
    self.titleL.font = [UIFont systemFontOfSize:15.0];
    self.titleL.numberOfLines = 0;
    self.titleL.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.titleL];
    
    self.introduceL = [UILabel new];
    self.introduceL.font = [UIFont systemFontOfSize:12.0];
    self.introduceL.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.introduceL];
    
    self.timeL = [UILabel new];
    self.timeL.backgroundColor = [UIColor magentaColor];
    self.timeL.textAlignment = NSTextAlignmentRight;
    self.timeL.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:self.timeL];
}

- (void)layoutSubviews
{

    [super layoutSubviews];
    [self.typeImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.left.equalTo(self.contentView).offset(10);
        
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-10);
        
        make.right.equalTo(self.titleL.mas_left).offset(-10);
        make.width.equalTo(@100);
    }];
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.left.equalTo(self.typeImageV.mas_right).offset(10);
        make.height.equalTo(@30);
    }];
    
    [self.introduceL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.titleL.mas_bottom).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.left.equalTo(self.typeImageV.mas_right).offset(10);
        make.height.equalTo(@20);
    }];
    
    [self.timeL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.introduceL.mas_bottom).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.left.equalTo(self.typeImageV.mas_right).offset(100);
        make.height.equalTo(@10);
    }];
}

@end
